<%--
  Created by IntelliJ IDEA.
  User: Wing
  Date: 2020/8/24
  Time: 15:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css">
    <title>Title</title>
</head>
<body>
<!-- 面板 -->
<div class="panel panel-default">
    <!-- 面板头-->
    <div class="panel-heading">
        <i class="glyphicon glyphicon-th"></i>数据列表
    </div>
    <!-- 面板体-->
    <div class="panel-body">
    <p  id="pageNum" value="1" hidden></p>
        <form class="form-inline"  role="form" style="float:left;">
            <div class="form-group has-feedback">
                <div class="input-group">
                    <div class="input-group-addon">用户id</div>
                    <input class="form-control has-success " type="text" id="u_idse" name="user_name" value="" placeholder="请输入查询条件">
                    <div class="input-group-addon">登记簿编号</div>
                    <input class="form-control has-success " type="text" id="registerBook_idse" name="registerBook_id" value="" placeholder="请输入查询条件">
                    <div class="input-group-addon">基本详情</div>
                    <input class="form-control has-success "  type="text" id="pp_idse" name="pp_id" value="" placeholder="请输入查询条件">
                </div>
            </div>
            <button  type="button" id="selectRegisterbook" class="btn btn-info"><i class="glyphicon glyphicon-search"></i> 查询</button>
<%--            <button type="button" class="btn btn-warning"><i class="glyphicon glyphicon-search"></i> 许可证查询</button>--%>
        </form>
        <form method="post">
            <button type="button" class="btn btn-danger" style="float:right;margin-left:10px;" id="deleteRegisterBooks"><i class=" glyphicon glyphicon-remove" ></i> 删除</button>
            <a  class="btn btn-primary" style="float:right;" data-toggle="modal" data-target="#addInfoModal" ><i class="glyphicon glyphicon-plus" ></i> 新增</a>
            <br>
            <br>
            <hr style="clear:both;">
            <!-- 响应式表格 -->
            <div class="table-responsive">
                <table id="registerTable" class=".table table-striped table-bordered table-hover" style="margin: 20px auto;width:100%">
                    <thead>
                    <tr >
                        <th>
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox">全选
                                </label>
                            </div>
                        </th>
                        <th>用户姓名(点击查看详情)</th>
                        <th>登记簿编号</th>
                        <th>基本信息(点击查看详情)</th>
                        <th>登记日期</th>
<%--                        <th>预售编号</th>--%>
<%--                        <th>预售状态</th>--%>
                        <th width="120px">操作</th>
                    </tr>
                    </thead>
                    <tbody>
							
                    </tbody>
                    <tfoot>
  

                    </tfoot>
                </table>
             <div id="page_div">
							</div>

            </div>

        </form>
    </div>
</div>
<!-- 显示详情 -->
<div class="modal fade" id="practicalInfoModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="infoModalLabel">具体详情</h4>
            </div>
            <div class="modal-body">
                <table id="registerInfoTable" class="table table-hover">
					<thead>
				
			</thead>
						<tbody>
						
						</tbody>
					</table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button"  id="practicalInfo_btn" class="btn btn-success" style="float:right;margin-left:10px;" formaction="#"><i class=" glyphicon glyphicon-print" ></i>打印</button>
            </div>
        </div>
    </div>
</div>
<!-- 显示详情结束 -->
<!-- 用户显示详情 -->
<div class="modal fade" id="UserInfoModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" >具体详情</h4>
            </div>
            <div class="modal-body">
                <table id="UserInfoTable" class="table table-hover">
					<thead>
				
			</thead>
						<tbody>
						
						</tbody>
					</table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button"  id="practicalInfo_btn" class="btn btn-success" style="float:right;margin-left:10px;" formaction="#"><i class=" glyphicon glyphicon-print" ></i>打印</button>
            </div>
        </div>
    </div>
</div>
<!-- 显示详情结束 -->
<!-- 增加模态框 -->
<div class="modal fade" id="addInfoModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myaddModalLabel">具体详情</h4>
            </div>
            <div class="modal-body">
                <p class="text-center"> 登记</p>
               <form class="form-horizontal" role="form" id="add_registerbook_form">
                   <div class="form-group">

                       <label for="user_name" class="col-sm-3 control-label">用户姓名:</label>
                       <div class="col-sm-9">
                           <input type="text" class="form-control" id="user_name"
                                  placeholder="请输入用户id" name="user_name">
                       </div>
                   </div>
                   <div class="form-group">
                       <label for="registerBook_id" class="col-sm-3 control-label">登记簿编号:</label>
                       <div class="col-sm-9">
                           <input type="text" class="form-control" id="registerBook_id"
                                  placeholder="请输入登记簿编号" name="registerBook_id">
                       </div>
                   </div>
                   <div class="form-group">
                       <label for="pp_id" class="col-sm-3 control-label">基本详情:</label>
                       <div class="col-sm-9">
                           <input type="text" class="form-control" id="pp_id"
                                  placeholder="请输入基本详情编号" name="pp_id">
                       </div>
                   </div>
                   <div class="form-group">
                       <label for="time" class="col-sm-3 control-label">登记时间:</label>
                       <div class="col-sm-9">
                           <input type="date" class="form-control" id="time"
                                  placeholder="请输入基本详情编号" name="time">
                       </div>
                   </div>
               </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" id="addInfo_btn">确定</button>
            </div>
        </div>
    </div>
</div>
<!-- 增加结束 -->
<!-- 修改模态框 -->
<div class="modal fade" id="updateInfoModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myupdateModalLabel">修改信息</h4>
            </div>
            <div class="modal-body">
                <p class="text-center"> 修改</p>
               <form class="form-horizontal" role="form" id="update_registerbook_form">
                   <div class="form-group">

                       <label for="rb_id" class="col-sm-3 control-label">登记簿编号:</label>
                       <div class="col-sm-9">
                           <input type="text" readonly class="form-control" id="rb_id2"
                                  value="" name="rb_id">
                       </div>
                   </div>
                   <div class="form-group">

                       <label for="user_name" class="col-sm-3 control-label">用户姓名:</label>
                       <div class="col-sm-9">
                           <input type="text" class="form-control" id="user_name2"
                                  value="" name="user_name">
                       </div>
                   </div>
                   <div class="form-group">
                       <label for="registerBook_id" class="col-sm-3 control-label">登记簿编号:</label>
                       <div class="col-sm-9">
                           <input type="text" class="form-control" id="registerBook_id2"
                                  value=""name="registerBook_id">
                       </div>
                   </div>
                   <div class="form-group">
                       <label for="pp_id" class="col-sm-3 control-label">基本详情:</label>
                       <div class="col-sm-9">
                           <input type="text" class="form-control" id="pp_id2"
                                  value="" name="pp_id">
                       </div>
                   </div>
                   <div class="form-group">
                       <label for="time" class="col-sm-3 control-label">登记时间:</label>
                       <div class="col-sm-9">
                           <input type="date" class="form-control" id="time2"
                                  placeholder="" value="" name="time">
                       </div>
                   </div>
               </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" id="updateRegisterbook_Info_btn">确定</button>
            </div>
        </div>
    </div>
</div>
<!-- 修改结束 -->
<!-- 单个删除 -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="mydeleteModalLabel">删除</h4>
            </div>
            <div class="modal-body">
                <p class="text-center">是否删除</span></p>
<%--                <form class="form-horizontal" role="form" id="add_role_form">--%>
<%--                    <div class="form-group">--%>

<%--                        <label for="rcode" class="col-sm-3 control-label">角色编号:</label>--%>
<%--                        <div class="col-sm-9">--%>
<%--                            <input type="text" class="form-control" id="rcode"--%>
<%--                                   placeholder="请输入角色编号" name="rcode">--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                    <div class="form-group">--%>
<%--                        <label for="rolename" class="col-sm-3 control-label">角色名称:</label>--%>
<%--                        <div class="col-sm-9">--%>
<%--                            <input type="text" class="form-control" id="rolename"--%>
<%--                                   placeholder="请输入角色名称" name="rolename">--%>
<%--                        </div>--%>
<%--                    </div>--%>
                <%--                </form>--%>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" id="deleteRegisterBook_btn">确定</button>
            </div>
        </div>
    </div>
</div>
<!-- 删除结束 -->
<!-- 警告框 -->
<div class="alert alert-danger alert-dismissible fade in" role="alert" hidden="hidden">
      <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
      <h4>删除确认!</h4>
      <p>Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
      <p>
        <button type="button" class="btn btn-danger">删除</button>
        <button type="button" class="btn btn-default">取消</button>
      </p>
    </div>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.12.3.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script type="text/javascript">

	//查询
	function selectRegisterbook(){
		$("#selectRegisterbook").click(function(){
			
			loadRegesterinfo();
		})
	}
    //登记簿列表
    function loadRegesterinfo() {
    	
    	var user_name=$("#u_idse").val();
    	
    	var registerBook_id=$("#registerBook_idse").val();
    	var pp_id=$("#pp_id").val();
    	
        $.ajax({
            url: "${pageContext.request.contextPath}/rbc/list",
            type: "post",
           dataType: "json",
            async: true,
            data:{"pageNum":$("#pageNum").val(),"user_name":user_name,"registerBook_id":registerBook_id,"pp_id":pp_id},
            error: function () {
                alert("显示列表错误！！！");

            },
            success: function (data) {
                //alert(data);
                var infoList = "";
                var pagelist = data.list;
                for (let i = 0; i < pagelist.length; i++) {
                    infoList = infoList + "<tr>";
                    infoList = infoList + "<td><input type='checkbox' name='registercheckId'   value='"+pagelist[i].rb_id+"'/></td>";
                    infoList = infoList + "<td name='userInfo' userinfo="+pagelist[i].pp_id+">" + pagelist[i].user_name + "</td>";
                    infoList = infoList + "<td>" + pagelist[i].registerBook_id + "</td>";
                    infoList = infoList + "<td name=practicalInfo parcticalinfo='"+pagelist[i].pp_id+"'>" + pagelist[i].pp_id + "</td>";
                    infoList = infoList + "<td>" + pagelist[i].time + "</td>";
                    infoList = infoList + "<td>" + "<button type='button' class='btn btn-danger btn-xs'  registerbookId="+pagelist[i].rb_id+" name='del_register_btn'>刪除<button type='button' class='btn btn-info btn-xs' name='update_register_btn' registerbookId="+pagelist[i].rb_id+">修改</td>";
                    infoList = infoList + "<td hidden='hidden' name='printStatu'>" + "打印状态" + "</td>";
                    infoList = infoList + "<td hidden='hidden' name='moredata'>" + "打印状态" + "</td>";
                    infoList = infoList + "</tr>";
                    var pageInfo="";
                    <!--显示分页信息-->
                    pageInfo = pageInfo + "<div align='center'>";
                    pageInfo = pageInfo + "<ul class='pagination'>";
					pageInfo = pageInfo
							+ "<li><a href='javascript:changePage(1)'>首页</a></li>";
							pageInfo = pageInfo + "<li>";
					if (data.hasPreviousPage) {
						pageInfo = pageInfo
								+ "<a href='javascript:changePage(-1)' aria-label='Previous'> <span aria-hidden='true'>«</span></a>";
					}
					pageInfo = pageInfo + "</li>";
					var navigatepageNums = data.navigatepageNums;
					for (var j = 0; j < navigatepageNums.length; j++) {
						if (navigatepageNums[j] == data.pageNum) {
							pageInfo = pageInfo
									+ "<li class='active'><a href='#'>"
									+ navigatepageNums[j]
									+ "</a></li>";
						}
						if (navigatepageNums[j] != data.pageNum) {
							pageInfo = pageInfo
									+ "<li><a href='javascript:changePage("
									+ navigatepageNums[j] + ")'>"
									+ navigatepageNums[j]
									+ "</a></li>";
						}
					}
					pageInfo = pageInfo + "<li>";
					if (data.hasNextPage) {
						pageInfo = pageInfo
								+ "<a href='javascript:changePage(-2)' aria-label='Next'> <span aria-hidden='true'>»</span> </a>";
					}
					pageInfo = pageInfo + "</li>";

					pageInfo = pageInfo
							+ "<li><a href='javascript:changePage("
							+ data.pages + ")'>尾页</a></li>";
							pageInfo = pageInfo + "</ul>";
					pageInfo = pageInfo + "</div>";
					pageInfo = pageInfo + "<div align='center'>当前第 "
							+ data.pageNum + " 页.总共 " + data.pages
							+ " 页.一共 " + data.total + " 条记录</div>";
					

                }

                $("#page_div").html(pageInfo);
                $("#registerTable tbody").html(infoList);


                parcticalInfo();
                deleteRegister();
                getUpdateRegisterBookInfo();
                UpdateRegisterBookInfo();
                selectRegisterbook();
                HouseInfo();
            }
        });
    }

    //获取修改信息
    function getUpdateRegisterBookInfo(){
		$("[name=update_register_btn").click(function(){
			
			var rb_id =$(this).attr("registerbookId");
			$.ajax({
				url:"${pageContext.request.contextPath}/rbc/getUpdateRegisterBookInfo",
				type:"post",
				async:true,
				dataType:"json",
				data:{"rb_id":rb_id},
				error:function(){
				alert("修改"+rb_id+"有误")	
				},
				success:function(data){
					//alert(data);
					$("#rb_id2").val(data.rb_id);
					$("#registerBook_id2").val(data.registerBook_id);
					$("#user_name2").val(data.user_name2);
					$("#pp_id2").val(data.pp_id);
					$("#time2").val(data.time);
					//$("#time2").placeholder(data.time);
					$('#updateInfoModal').modal('show');
				}
			})
		});
	}
    
    //修改
    function UpdateRegisterBookInfo(){
			$("#updateRegisterbook_Info_btn").click(function(){
			
				$.ajax({
					url:"${pageContext.request.contextPath}/rbc/updateRegisterBook",
					type:"post",
					async:true,
					data : $("#update_registerbook_form").serialize(),
					error : function() {
						alert("修改后错误！！！");
					},
					success : function(data) {
						alert(data);
						//隐藏模态框
						$('#updateInfoModal').modal('hide');
						loadRegesterinfo();
					}
				})
			});
		}
	//增加
	function addRegisterbook(){
		$("#addInfo_btn").click(function(){
			$.ajax({
				url:"${pageContext.request.contextPath}/rbc/addRegisterbook",
				type : "post",
				 //dataType: "json",
	           	 async: true,
	           	data : $("#add_registerbook_form").serialize(),
// 	           	 error: function () {
// 	                alert("增加错误错误！！！");
	              
	             
// 	            },
	            success:function(data){
	            	alert(data);
	            	//隐藏模态框
					$('#addInfoModal').modal('hide');
					loadRegesterinfo();
	            }
				})
				$('#addInfoModal').on('hidden.bs.modal', function(e) {
				$('#add_registerbook_form [name=user_name]').val("");
				$('#add_registerbook_form [name=registerBook_id]').val("");
				$('#add_registerbook_form [name=time]').val("");
				$('#add_registerbook_form [name=pp_id]').val("");
			})
		});
	}
    //房屋详情模态框
    function HouseInfo() {
        $("[name=practicalInfo]").click(function () {
            var pp_id = $(this).attr("parcticalinfo");
     //      	confirm(pp_id)
   
								$
										.ajax({
											url : "${pageContext.request.contextPath}/rbc/getHouseByh_id",
											type : "post",
											
											data : {
												"pp_id" : pp_id
											},
											error : function() {
												alert("获取房屋信息有误！！！");
											},
											success : function(data) {
												var houseInfo = JSON.parse(data);
												var infoList="";
												 infoList = infoList + "<tr>";
								                    infoList = infoList + "<td> <p> 大小 </p>"+ houseInfo.house_area + " m²</td>";
								                    infoList = infoList + "</tr>";
								                    infoList = infoList + "<tr>";
								                    infoList = infoList + "<td> <p> 户型 </p>"+ houseInfo.house_shape + "</td>";
								                    infoList = infoList + "</tr>";
								                    infoList = infoList + "<tr>";
								                    infoList = infoList + "<td> <p> 楼层 </p>"+ houseInfo.house_floor + "</td>";
								                    infoList = infoList + "</tr>";
								                    infoList = infoList + "<tr>";
								                    infoList = infoList + "<td> <p> 状态 </p>"+ houseInfo.house_status + "</td>";
								                    infoList = infoList + "</tr>";
								                    infoList = infoList + "<tr>";
								                    infoList = infoList + "<td> <p> 朝向 </p>"+ houseInfo.house_structure + "</td>";
								                    infoList = infoList + "</tr>";
								                    infoList = infoList + "<tr>";
								                    infoList = infoList + "<td> <p> 交房时间 </p>"+ houseInfo.house_time + "</td>";
								                    infoList = infoList + "</tr>";
								                    if (houseInfo.house_assets) {
								                    	infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 所属权 </p>"+ houseInfo.house_assets + "</td>";
									                    infoList = infoList + "</tr>";
													}else {
														infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 所属权 </p>无</td>";
									                    infoList = infoList + "</tr>";
													}
								                    if (houseInfo.house_jurisdictionType) {
								                    	infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 权 </p>"+ houseInfo.house_jurisdictionType + "</td>";
									                    infoList = infoList + "</tr>";
													} else {
														infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 权 </p>无</td>";
									                    infoList = infoList + "</tr>";
													}
								                    
								                 if (houseInfo.house_jurisdictionNumber) {
								                	 infoList = infoList + "<tr>";
									                    infoList = infoList + "<td> <p> 权的编号 </p>"+ houseInfo.house_jurisdictionNumber + "</td>";
									                    infoList = infoList + "</tr>";
												}else {
													infoList = infoList + "<tr>";
								                    infoList = infoList + "<td> <p> 权的编号 </p>无</td>";
								                    infoList = infoList + "</tr>";
												}    
												
									                
									       
												$("#registerInfoTable tbody").html(
														infoList);
												$('#practicalInfoModal').modal(
														'show');

											}
										})

						
            
            
            
            
            
            
            
            
            
            
            
  
        });
    }
    //用户详情模态框
    function parcticalInfo() {
        $("[name=userInfo]").click(function () {
            var pp_id = $(this).attr("userinfo");
           //	confirm(pp_id)
   
								$
										.ajax({
											url : "${pageContext.request.contextPath}/rbc/getPPByppid",
											type : "post",
											
											data : {
												"pp_id" : pp_id
											},
											error : function() {
												alert("获取用户信息有误！！！");
											},
											success : function(data) {
												var Proposer = JSON.parse(data);
												var infoList="";
									                    
												infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 申请人编号: </span>"+ Proposer.proposer_id + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 申请人名称:</span>"+ Proposer.proposer_name + "岁</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 申请人年龄:</span>"+ Proposer.proposer_age + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 申请人电话:</span>"+ Proposer.proposer_phone + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 申请人户籍:</span>"+ Proposer.proposer_census_register + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 申请人住址:</span>"+ Proposer.proposer_address + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 审核:</span>"+ Proposer.proposer_check + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 审批:</span>"+ Proposer.proposer_remark + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 意见:</span>"+ Proposer.proposer_approval + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 共有人名称:</span>"+ Proposer.proposer_ownerName + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 共有人年龄:</span>"+ Proposer.proposer_ownerAge + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 共有人电话:</span>"+ Proposer.proposer_ownerPhone + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 共有人户籍:</span>"+ Proposer.proposer_owner_register + "</td>";
							                    infoList = infoList + "</tr>";
							                    infoList = infoList + "<tr>";
							                    infoList = infoList + "<td> <span> 申请日期:</span>"+ Proposer.proposer_date + "</td>";
							                    infoList = infoList + "</tr>";
									       
												$("#UserInfoTable tbody").html(
														infoList);
												$('#UserInfoModal').modal(
														'show');

											}
										})

						
            
            
            
            
            
            
            
            
            
            
            

        });
    }

    //单个删除
    function deleteRegister() {
        $("[name=del_register_btn]").click(function () {
         //  var rb_id = $(this).parents("tr").children("td").first().text();
			var rb_id2=$(this).attr("registerbookId");
			//alert(rb_id);
			//alert(rb_id2);
            $("#deleteModal").modal('show');
           // alert(111);
            $("#deleteRegisterBook_btn").click(function () {
                $.ajax({
                    url: "${pageContext.request.contextPath}/rbc/deleteRegisterbookById",
                    type: "post",
                    //dataType: "json",
                   
                    async: true,
                    data:{"rb_id":rb_id2},
                    error: function () {
                        alert("删除有误！！！");
                    },
                    success: function (data) {
                        alert(data);
                        $('#deleteModal').modal('hide');
                        loadRegesterinfo();
                    }
                });
            });
        });
    }
    //多个删除
    function deleteRegisters() {
        $("#deleteRegisterBooks").click(function () {
         //  var rb_id = $(this).parents("tr").children("td").first().text();
			var rb_ids=[];
			$(":checkbox[name=registercheckId]:checked").each(function(){
				rb_ids.push($(this).val());
			});
			//alert(rb_id);
			if(rb_ids==""){
				alert("请至少选择一个");
				return;
			}
			if(!confirm("是否要删除"+rb_ids+"?")){
				return;
			}
				
            
                $.ajax({
                    url: "${pageContext.request.contextPath}/rbc/deleteRegisterbooksById",
                    type: "post",
                    //dataType: "json",
                   
                    async: true,
                    data:{"rb_ids":rb_ids.join(",")},
                    error: function () {
                        alert("删除有误！！！");
                    },
                    success: function (data) {
                        alert(data);
                       
                        loadRegesterinfo();
                    }
                });
            
        });
    }
  //翻页
	function changePage(page) {
		var pn = $("#pageNum").val();
		if (page == -1) {
			$("#pageNum").val(pn - 1);
		} else if (page == -2) {
			var pn1 = parseInt(pn);
			$("#pageNum").val(pn1 + 1);
		} else {
			$("#pageNum").val(page);
		}
		loadRegesterinfo();
	}

    $(function () {
        //获取所有登记簿信息
        loadRegesterinfo();
        deleteRegisters();
        addRegisterbook();
        changePage(page);

        
    })

</script>
</body>
</html>
